package my.headfirstjava.observer.v3;

import java.util.Observable;

/**
 * author: xl
 * time: 2018/8/23 9:35
 * description:
 **/
public class Subject extends Observable {

    WeatherData weatherData;

    public Subject( ){

    }
    public Subject(WeatherData weatherData){
        this.weatherData=weatherData;
    }

    public void measurementsChange(){
        setChanged();
        notifyObservers();
    }

    public WeatherData getWeatherData() {
        return weatherData;
    }

    public void setWeatherData(WeatherData weatherData) {
        this.weatherData = weatherData;
    }
}
